//package com.jackrain.clouddata.oms.lts;
//
//import com.github.ltsopensource.spring.TaskTrackerAnnotationFactoryBean;
//import com.github.ltsopensource.tasktracker.TaskTracker;
//import com.jackrain.nea.config.PropertiesConf;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.BeansException;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.ApplicationContextAware;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * Created by nathan on 2016/9/8.
// */
//
//@Slf4j
//@Configuration
//public class TaskTrackerConfig implements ApplicationContextAware {
//
//    private ApplicationContext applicationContext;
//
//    @Autowired
//    private PropertiesConf pconf;
//
//    @Override
//    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException{
//        this.applicationContext = applicationContext;
//    }
//
//    @Bean
//    public TaskTracker taskTracker() throws Exception{
//        // pconf= ApplicationContextHandle.getBean("propertiesConf");
//        String REGISTRY_ADDRESS=pconf.getProperty("zookeeper.server");
//        TaskTrackerAnnotationFactoryBean factoryBean = new TaskTrackerAnnotationFactoryBean();
//        factoryBean.setApplicationContext(applicationContext);
//        factoryBean.setJobRunnerClass(JobRunnerDispatcher.class);
//        factoryBean.setLocations("config/lts.properties");
//        factoryBean.afterPropertiesSet();
//        factoryBean.getObject().setRegistryAddress(REGISTRY_ADDRESS);
//        factoryBean.start();
//        log.debug("jobrunner addr->"+REGISTRY_ADDRESS);
//        return factoryBean.getObject();
//    }
//}
